package service;

import Utils.db.pojo.Page;
import Utils.db.service.PageService;
import pojo.User;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

/**
 * @author d11yu
 */
public interface UserService extends PageService<User> {
    /**
     * 注册
     *
     * @param user
     * @return
     */
    public User register(User user) throws SQLException;

    /**
     * 登录
     *
     * @param user
     * @return
     */
    public User login(User user) throws SQLException;

    /**
     * 检查user是否存在
     *
     * @param user
     * @return
     */
    public boolean exists(User user) throws SQLException;

    /**
     * 检查user是否存在
     *
     * @param username
     * @return
     */
    public boolean exists(String username) throws SQLException;

    public Page<User> getPageByUsernameBlur(Integer pn, Integer ecp, String urlAction, String username) throws SQLException, InvocationTargetException, IllegalAccessException;

    public void update(User user);

    public void deleteById(Integer id);
    public User queryById(Integer id) throws SQLException;
}
